package com.scoressystem.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class Results<T> {
    private String code; // 状态码
    private String msg; // 提示信息
    private T data;// 数据
    private long count; // 总记录数

    /**
     * 成功的结果
     * 只有状态码和提示信息的构造
     */
    public Results(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Results(String code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
}